import { createApp } from "vue";

import App from "./App.vue";
import router from "@/router";
import { createPinia } from "pinia";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate"; //引入持久化插件
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate); //将插件添加到 pinia 实例上
// icon
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
// 样式
import "@/styles/index.scss";
import "uno.css";
// 动画库
import "animate.css";
// 本地svg图标
import "virtual:svg-icons-register";
// import "./permission.js";

// 全屏滚动效果
import "vue-fullpage.js/dist/style.css";
import VueFullpage from "vue-fullpage.js";

//国际化语言
import i18n from "@/lang";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";

const app = createApp(App);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.config.warnHandler = (msg, vm, trace) => {
  // 可以在这里根据情况处理警告，比如不做任何处理，或者将警告记录到日志中
};
app.use(VueFullpage);
app.use(router);
app.use(pinia);
app.use(i18n);

app.use(ElementPlus);
app.mount("#app");
